<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线问答</title>
    <style type="text/css">
        #table tr:nth-child(even) {
            background-color: greenyellow;
        }
    </style>
    <script type="text/javascript" src="js/jquery-3.4.1.js"></script>
    <script type="text/javascript">
        $(function () {
            var t = $("#table");
            $.get("searchAll", function (data) {
                var list = data.data;
                $.each(list, function (i, d) {
                    t.append("<tr><td>" + d.id + "</td><td><a href='answer-add.html?" + d.id + "'>" + d.title + "</a></td><th>" + d.answerCount + "</th><th>" + d.lastModified + "</th></tr>");
                });
            });
        });
    </script>
</head>
<body>
<h1 style="margin:20px auto;  display:table;">在线问答</h1>
<div style="margin:20px auto;  display:table;"><a href="questions-add.html">我要提问</a></div>
<table id="table" cellpadding="0" cellspacing="3" style="margin:20px auto; width: 700px; display:table;">
    <tr style="background: #acdce8;">
        <th>序号</th>
        <th width="250px">问题</th>
        <th>回答次数</th>
        <th>最后修改</th>
    </tr>

</table>
</body>
</html>